# Maintainer: Daniel Isenmann <daniel@archlinux.org>

pkgname=babl
_tag='ddb6912548e1490edc9638a37b1fa4f16b5e044b'
pkgver=0.1.104
pkgrel=1
pkgdesc='Dynamic, any to any, pixel format conversion library'
arch=('x86_64')
url='https://gegl.org/babl/'
license=('LGPL3')
depends=('glibc' 'lcms2')
makedepends=('git' 'meson' 'gobject-introspection' 'vala')
source=("git+https://gitlab.gnome.org/GNOME/babl.git#tag=$_tag")
sha256sums=('SKIP')

pkgver() {
  cd "${pkgname}"
  git describe --tags | sed 's/^BABL_//;s/_$//;s/_/./g;s/-/+/g'
}

prepare() {
  # https://gitlab.gnome.org/GNOME/babl/-/merge_requests/45
  sed -i s/Description/description/ "${pkgname}"/meson.build
}

build() {
  arch-meson "${pkgname}" build
  ninja -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  DESTDIR="${pkgdir}" meson install -C build
}
